<!DOCTYPE html>
<html>
<head>
    <title>云服务器ECS</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("oa:escinstances:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("oa:escinstances:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("oa:escinstances:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
			
			 <a class="btn btn-primary" @click="updateECS"><i class="fa fa-pencil-square-o"></i>&nbsp;更新过期时间</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
					<div class="form-group">
                        <div class="col-sm-2 control-label">Access ID</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="escInstances.accessKeyId" placeholder="阿里云AccessKey ID"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">Access Secret</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="escInstances.accessKeySecret" placeholder="阿里云AccessKey Secret"/>
                        </div>
                    </div>
                    
                    <div class="form-group">
						<div class="col-sm-2 control-label">服务类型</div>
						<label class="radio-inline">
							<input v-if="escInstances.type != 'undefined'" type="radio" name="type" v-model="escInstances.type" value="1"/> 云服务器 ESC
						</label>
						<label class="radio-inline">
							<input v-if="escInstances.type != 'undefined'" type="radio" name="type" v-model="escInstances.type" value="2"/> 云数据库 RDS
						</label>
						<label class="radio-inline">
							<input v-if="escInstances.type != 'undefined'" type="radio" name="type" v-model="escInstances.type" value="3"/> 域名
						</label>
					
					</div>
                    
					<div class="form-group" v-show="escInstances.type == 1">
                        <div class="col-sm-2 control-label">地域ID</div>
                        <div class="col-sm-10 form-group-sm">
                            <!-- <input type="text" class="form-control" v-model="escInstances.regionId" placeholder="地域ID"/> -->
                        	<select name="interest"  v-model="escInstances.regionId" class="form-control">
					        <option value="cn-qingdao">华北 1	青岛</option>
					        <option value="cn-beijing">华北 2	北京</option>
					        <option value="cn-zhangjiakou">华北 3	张家口</option>
					        <option value="cn-huhehaote">华北 5	呼和浩特</option>
					        <option value="cn-hangzhou">华东 1	杭州</option>
					        <option value="cn-shanghai">华东 2	上海</option>
					        <option value="cn-shenzhen">华南 1	深圳</option>
					      </select>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-2 control-label">实例ID</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="escInstances.instanceId" placeholder="实例ID"/>
                        </div>
                    </div>
											                   
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/oa/escinstances.js?_${.now?long}"></script>
</body>
</html>